package com.lanou.web.controller;

import com.lanou.service.TbItemCatService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;


/**
 * Created by QuChao on 2018/11/9
 */
@Controller
public class TbItemCatController {

    @Autowired
    private TbItemCatService tbItemCatService;

    @ResponseBody
    @RequestMapping("/item/cat/list")
    public List<Object> catList(@RequestParam(value = "id", defaultValue = "0") Integer id) {
        return tbItemCatService.findCatByParentId(id);
    }

}
